﻿///<copyright>
/// Copyright © 2009 Stephen Styrchak. All Rights Reserved.
///</copyright>
using System;
using Microsoft.Xna.Framework;

namespace Ferpect.ComponentModel
{
    /// <summary>
    /// This service manages game pad and keyboard input for a game. It allows a game
    /// to associate each game player with a PlayerIndex (which identifies a game pad).
    /// Games typically initialize the PlayerNNN properties early in the game by having
    /// players press Start on their respective controllers.
    /// </summary>
    public interface IInputService
    {
        /// <summary>
        /// Gets/sets the player index of player one. This property must be set explicitly
        /// by the game after determining which PlayerIndex value represents player two.
        /// </summary>
        Nullable<PlayerIndex> PlayerOne { get; set; }
        /// <summary>
        /// Gets/sets the player index of player two. This property must be set explicitly
        /// by the game after determining which PlayerIndex value represents player two.
        /// </summary>
        Nullable<PlayerIndex> PlayerTwo { get; set; }
        /// <summary>
        /// Gets/sets the player index of player three. This property must be set explicitly
        /// by the game after determining which PlayerIndex value represents player three.
        /// </summary>
        Nullable<PlayerIndex> PlayerThree { get; set; }
        /// <summary>
        /// Gets/sets the player index of player four. This property must be set explicitly
        /// by the game after determining which PlayerIndex value represents player four.
        /// </summary>
        Nullable<PlayerIndex> PlayerFour { get; set; }
        /// <summary>
        /// Gets the system keyboard state. For chat pad keyboards, use the KeyboardInputState
        /// off the player-specific InputState instances.
        /// </summary>
        KeyboardInputState Keyboard { get; }
        /// <summary>
        /// Gets the input state associated with the specified game pad PlayerIndex.
        /// </summary>
        /// <param name="playerIndex">The index of the game pad whose input state will be retrieved.</param>
        /// <returns>The input state of the specified game pad index.</returns>
        InputState GetInputState(PlayerIndex playerIndex);
    }
}
